home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 24 / 024.d81 / inside the 1571 (.txt) < prev    next >
Commodore BASIC  |  2022-08-26  |  5KB  |  133 lines

  1. 190 t$(0)="del":t$(1)="seq":t$(2)="prg":t$(3)="usr":t$(4)="rel":close15
  2. 200 dm$(0)="single": dm$(1)="double"
  3. 210 dim a$(256): nl$=chr$(0): q$=chr$(34): sp$=chr$(160)
  4. 220 printchr$(142)"[147]      [176][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][174]"
  5. 230 print "      [194]      disk utilities     [194]"
  6. 240 print "      [173][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][189]"
  7. 250 close 2: close 4: close 15: open 15,8,15
  8. 260 print#15,"u0>m9": input#15,en
  9. 270 if en<>31 then dt=0: dm=0: print spc(11);"disk drive = 1541": goto 300
  10. 280 dt=1: print#15,"u0>h0": input#15,en: dm=0: if en=31 then dm=1
  11. 290 print"disk drive = 1571, in ";dm$(dm);" sided mode"
  12. 300 print"[195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195]"
  13. 310 print"  1 = normal directory     (side 1/2)"
  14. 320 print"  2 = full directory    (deleted files)"
  15. 330 print"  3 = lock/unlock file"
  16. 340 print"  4 = change disk name"
  17. 350 print"  5 = issue disk command"
  18. 360 ml=5: am=(dm+1) and 1: if dt=0 then print: goto 390
  19. 370 print"  6 = switch drive to ";dm$(am);" sided mode": ml=6
  20. 380 print spc(22);"[163][163][163][163][163][163]"
  21. 390 print"  q = quit"
  22. 400 print"[195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195]"
  23. 410 print"desired function: ";
  24. 420 get c$: if c$="" then 420
  25. 430 if c$="q" then print c$: goto 1500
  26. 440 f=val(c$): if f<1 or f>ml then 420
  27. 450 print c$: on f goto 550,550,520,550,470
  28. 460 print#15,"u0>m"+chr$(48+am): goto 220
  29. 470 print"desired disk command (in quotes):"
  30. 480 gosub 1490: if x$=sp$ then 220
  31. 490 print#15,x$: input#15,en,em$,et,es
  32. 500 print"error#:";en;"   trk/sec:";et;"/";es
  33. 510 print em$: gosub 1450: goto 220
  34. 520 print "filename to be locked/unlocked:"
  35. 530 gosub 1490: if x$=sp$ then 220
  36. 540 fl$=left$(x$+"[160][160][160][160][160][160][160][160][160][160][160][160][160][160][160][160]",16): rem (16 shifted spaces)
  37. 550 print#15,"i0": input#15,en,em$,et,es: if en=0 then 580
  38. 560 if en<>21 and t<>18 and s<>0 then gosub 1440: goto 220
  39. 570 print"please insert disk & reselect function!": goto 1130
  40. 580 open2,8,2,"#0": gosub 1430: if en>0 then 220
  41. 590 print "ok, reading block avail map (bam)..."
  42. 600 t=18: s=0: gosub 1300: if en>0 then 220
  43. 610 h1$="disk "+q$: for n=144 to 159: h1$=h1$+a$(n): next n
  44. 620 h1$=h1$+q$+"  id="+a$(162)+a$(163)+"   fmt="+a$(165)+a$(166)
  45. 630 c=0: for n=4 to 140 step 4: c=c+asc(a$(n)): next n
  46. 640 if asc(a$(3))>0 then for n=221 to 255: c=c+asc(a$(n)): next n
  47. 650 h2$=right$("     "+str$(c),5)+" blocks free        ("
  48. 660 h2$=h2$+dm$(asc(a$(3))/128)+" sided)"
  49. 670 pd=3: if f>2 then 720
  50. 680 print"printed output wanted (y/n): ";
  51. 690 get c$: if c$="n" then 720
  52. 700 if c$<>"y" then 690
  53. 710 pd=4: gosub 1220
  54. 720 open 4,pd
  55. 730 gosub 1260: if f<>4 then 830
  56. 740 print"enter new disk name for this disk:"
  57. 750 gosub 1490: if x$=sp$ then 1200
  58. 760 iflen(x$)>16thenprint"input string is longer than 16 chars!":goto740
  59. 770 x$=left$(x$+"[160][160][160][160][160][160][160][160][160][160][160][160][160][160][160][160]",16): rem (16 shifted spaces)
  60. 780 print#15,"b-p:2,144": gosub 1430: if en>0 then 220
  61. 790 print#2,x$;
  62. 800 print#15,"u2:2,0,";t;s: gosub 1430: if en>0 then 220
  63. 810 print#15,"i0"
  64. 820 print"  disk bam updated with new disk name": goto 1130
  65. 830 if f=3 then print"searching for file: ";q$;fl$;q$: print
  66. 840 t=asc(a$(0)): s=asc(a$(1)): if t>0 then 870
  67. 850 if f=3 then print spc(12);"file not found"
  68. 860 goto 1130
  69. 870 gosub 1300: if en>0 then 220
  70. 880 for n=2 to 226 step 32: ft=asc(a$(n)) and 7
  71. 890 if ft=0 and f<>2 then 1190
  72. 900 c=asc(a$(n+28))+(asc(a$(n+29))*256)
  73. 910 if c=0 then h=0:for x=3 to 18:h=h+asc(a$(n+x)):next x:if h=0 then 790
  74. 920 n$="": for y=3 to 18: n$=n$+a$(n+y): next y
  75. 930 if f=3 then if fl$<>n$ then 1190
  76. 940 print#4,right$("     "+str$(c),5);" ";q$;n$;
  77. 950 print#4,q$;"  ";t$(ft);"  ";: if ft=0 then 1010
  78. 960 lk=0: if (asc(a$(n)) and 192)=192 then print#4,"(l)";: lk=1: goto 990
  79. 970 op=0: if (asc(a$(n)) and 128)=0 then print#4,"(o)";: op=1: goto 1010
  80. 980 print#4,"   ";
  81. 990 print#4,"  ";
  82. 1000 gosub 1330: if en>0 then 220
  83. 1010 print#4: if f<>3 then 1140
  84. 1020 if op=1 then print"file is not properly closed!": goto 1130
  85. 1030 print"ok to ";: if lk=1 then print"un";
  86. 1040 print"lock file (y/n): ";
  87. 1050 get c$: if c$="n" then 1210
  88. 1060 if c$<>"y" then 1050
  89. 1070 print c$
  90. 1080 h=(asc(a$(n)) and 191): if lk=0 then h=h+64
  91. 1090 print#15,"b-p:2,";n: gosub 1430: if en>0 then 220
  92. 1100 print#2,chr$(h);
  93. 1110 print#15,"u2:2,0,";t;s: gosub 1430: if en>0 then 220
  94. 1120 print"directory updated with new lock status"
  95. 1130 print: gosub 1450: goto 220
  96. 1140 l=l-1: if l=0 then gosub 1240: if c$="q" then 220
  97. 1150 if pd=3 then 1190
  98. 1160 get c$: if c$="" then 1190
  99. 1170 print spc(10);"output suspended": gosub 1460: if c$="q" then 220
  100. 1180 gosub 1220
  101. 1190 next n: goto 840
  102. 1200 print spc(8);"no change to disk name": goto 1130
  103. 1210 print c$: print spc(8);"no change to directory": goto 1130
  104. 1220 print"[147]printing disk directory"
  105. 1230 print"press any key to pause output": return
  106. 1240 if pd=4 then for x=1 to 10: print#4: next x: c$="": goto 1260
  107. 1250 gosub 1460: if c$="q" then return
  108. 1260 l=50: if pd=3 then l=16: print"[147]";
  109. 1270 print#4,h1$: print#4: print#4,h2$
  110. 1280 print#4: print#4,"---------------------------------------"
  111. 1290 print#4: return
  112. 1300 print#15,"u1:2,0,";t;s: gosub 1430: if en>0 then return
  113. 1310 for n=0 to 255: get#2,a$(n): if a$(n)="" then a$(n)=nl$
  114. 1320 next n: return
  115. 1330 en=0: if f=3 then return
  116. 1340 t=asc(a$(n+1)): s=asc(a$(n+2)): gosub 1370
  117. 1350 if (en+h)>0 or ft<>4 then return
  118. 1360 t=asc(a$(n+19)): s=asc(a$(n+20))
  119. 1370 h=0: if t>35 then h=1: print#4,"(2)";: return
  120. 1380 print#15,"u1:2,0,";t;s: gosub 1430: if en>0 then return
  121. 1390 get#2,c$,d$: if c$="" then c$=nl$
  122. 1400 if d$="" then d$=nl$
  123. 1410 t=asc(c$): s=asc(d$): if t>0 then 1370
  124. 1420 return
  125. 1430 input#15,en,em$,et,es: if en=0 then return
  126. 1440 print: print"disk error:[146]";en;"  trk/sec:[146]";et;"/";es: print em$
  127. 1450 print"       press any key to continue       ": goto 1470
  128. 1460 print"press any key to continue, 'q' to quit[146]";
  129. 1470 get c$: if c$="" then 1470
  130. 1480 return
  131. 1490 print"";sp$;"[157][157][157]";: input x$: return
  132. 1500 close 2: close 4: close 15:load"hello connect",8
  133.